import React from 'react';
import { ck_empty, loc, ck_int, useKForm, KDlg, KInput } from 'sui';

const DlgVal = (props) => {
    const form = useKForm(props.data);

    const ck = {
        num: (v) => ck_int(v),
        des: (v) => ck_empty(v),
    };

    return (
        <KDlg {...props} title={loc("l_711")} ck={ck} form={form}>
            <KInput label={loc("l_127")} name="num" form={form}/>
            <KInput label={loc("l_762")} name="des" form={form}/>
        </KDlg>
    );
};

const DlgBack = (props) => {
    const form = useKForm(props.data);

    const ck = {
        num: (v) => ck_int(v),
    };

    return (
        <KDlg {...props} title={loc("l_763")} ck={ck} form={form}>
            <KInput label={loc("l_127")} name="num" form={form}/>
        </KDlg>
    );
};

export {DlgBack, DlgVal};
